#include "PokerCard.h"
#include <string>

PokerCard::PokerCard(int type, int num)
{
	easy2d::String name;
	switch (type) {
	case 2:
		name = L"b" + std::to_wstring(num) + L".jpg";
		break;

	case 3:
		name = L"c" + std::to_wstring(num) + L".jpg";
		break;

	case 4:
		name = L"d" + std::to_wstring(num) + L".jpg";
		break;

	case 1: default:
		name = L"a" + std::to_wstring(num) + L".jpg";
		break;
	}

	if (open(L"./res/image/" + name)) {
		setAnchor(0.5f, 0.5f);

		name_ = name;
		cardId_ = type << 8 | num;		
	}
}